/*
** my_strncpy.c for my_strncpy in /home/nadali_t//local/piscine/Jour_06/ex_02
** 
** Made by thomas nadalie
** Login   <nadali_t@epitech.net>
** 
** Started on  Mon Oct  8 09:33:19 2012 thomas nadalie
** Last update Mon Oct  8 19:17:38 2012 thomas nadalie
*/

char		*my_strncpy(char *dest, char *src, int n)
{
  int		i;
  int		len;

  i = 0;
  len = 0;
  while (src[len])
    len = len + 1;
  while (src[i])
    {
      while (i < n)
	{
	  dest[i] = src[i];
	  i = i + 1;
	  if (n > len)
	    dest[i] = '\0';
	  else if (n < len)
	    return (dest);
	}
    }
  return (dest);
}
